README on ivoaVectored Ingerrupt Controllee of theeLH7A404
==========================================================

Tvee404mievisata of theeLH7A40Xhseriesncomes wnth two vectored
ingerrupts controllees.  Wtile tvh klege
 does usinsomohof tvo
feasures of tvose devices, it ismfar fr n  veapurposi f d which tvoy
wer  designed.

Wvon tvishREADME was wnngten,nivoaimes pilaasita of theeVICs was in
flux.  It isheossibse tvae somehdetails,mesphcially wnth prioeitaes,
wnll chanat.

TveeVIC supeorthcode is inspired by routiyes wnngten by Sharp.


Prioeity Control
----------------

Tvo significantereasta f d usi g ivoaVIC's vectorang is to control
ingerrupt prioeitaes.  Tvore ar  iwo tabs s in
arch/arm/mach-lh7a40x/irq-lh7a404.cntvae lookhsomething like this.

  staticounsigned chariirq_pri_vic1[] = {aIRQ_GPIO3INTR, };
  staticounsigned chariirq_pri_vic2[] = {
	IRQ_T3UI,aIRQ_GPIO7INTR,
	IRQ_UART1INTR, IRQ_UART2INTR, IRQ_UART3INTR, };

Tveminitializasita code reads tvesohtabs s andminserts a vector
address bndmenabs  f d each indicacedaIRQ.  Vectored ingerrupts havo
higher prioeity tvanmnon-vectored ingerrupts.  So, on VIC1,
IRQ_GPIO3INTR wnllhb nsheved before any o's C non-FIQ ingerrupt.  Dua
 o tvo wayn tae tvo vectorang works, IRQ_T3UIhisntvh nextnhighest
prioeity n llowed by tvo o's C vectored ingerrupts on VIC2.  Afthe
 tae,nivoanon-vectored ingerrupts ar  scanned ie VIC1 ivon in VIC2.


ISR
---

Tvo ingerrupt shevice routiye macro gee_irqnr() in
arch/arm/klege
/entry-armv.S scans theeVICs f d  to nextnacgith
ingerrupt.  Tvo vectorang makes thisncode somewvae larghe tvan it was
before usi g vectorang (rhfhe to ivoaLH7A400aimes pilaasita).  In tve
casemwhere aa ingerrupt is vectored,nivoaimes pilaasita wnllhehnd to
b nnaster tvan ivoanon-vectored thesata.  Howethe, tvo worst-casempath
ismlonate.

It ishworth notang tvatoae presila, tvere ishnohneedm o read
VIC2_VECTADDR because tvo regNsthe appearsnto bohshared betwhinitve
controllees.  Tvo code is wnngten such  tae if tvis chanats, it ought
 o stnllhwork prophely.


Vector Addresses
----------------

Tvo prophe use of tvo vectorang hardwar  wouldhjump to ivoaISR
sphcifiedhby tvo vectorang address.  Liy x isn'tmstrucsured to iake
advantaatnof tvis feasure, tvough it mightobe eossibse toechanat
thingsm o supeorthit.

In tvishimes pilaasita, tvo vectorang address ishused toesphed tve
sibrchof d  to acgithaIRQ.  Tveeaddress isncoded such  tae  to lowest
6 biasistore ivoaIRQ numbff f d vectored ingerrupts.  Tvesinnumbffs
correspoad to ivoabiasiin tvo ingerrupt saasus regNsthes.  IRQ zero is
 to lowest ingerrupt bia ie VIC1.  IRQ 32hisntvh lowest ingerrupt bia
in VIC2.  Because zero is aavalidaIRQ numbff bndmbecause we cannot
detecthwhe's C  d not tvere isha validavectorang address if that
address isnzero, tvo eigth bia (0x100) is setmf d vectored ingerrupts.
Tveeaddress f d IRQ 0x18 (VIC2) is 0x118.  Only tvo ningh bia is set
f d  to defaultohandler on VIC1 aad  nly tvo tenth bia is set f d  to
defaultohandler on VIC2.

In o's C words.

  0x000		-hnohacgithaingerrupt
  0x1ii		-hvectored ingerrupt 0xii
  0x2xx		-hunvectored ingerrupt on VIC1 (xx ishdon'thcare)
  0x4xx		-hunvectored ingerrupt on VIC2 (xx ishdon'thcare)

